To replicate all of the figures and results in the paper,

1) Obtain the CER data. See http://www.ucd.ie/issda/data/commissionforenergyregulationcer/. 

Put it in /Data/CER Electricity Data/ with the consumption data files ("File1.txt" - "File5.txt") in a ./ConsumpData subfolder. The column headers of the survey and treatment assignemnt datasheets were renamed for brevity, extraneous cells were cut, and the data was converted to .csv files "assignments.csv", "cer_survey_pre.csv", and "cer_survey_post.csv".

2) Change the working directories CER_Elec_Analysis.R and CER_Elec_Analysis_Appendix.R as appropriate.
3) Run the code in CER_Elec_Analysis.R. This will conduct the main analysis. 
4) Run the code in CER_Elec_Analysis_Appendix.R. This will conduct the secondary analysis. The main analysis must be run first, since it uses data generated by the main analysis file.

Outputs will appear in the ./Output/ folder

It may take a little while to run due to the memory demands of the large panel dataset. This was run on a computer with 32 GB of memory, and it took about 1.5 hours to run both files.

Note that a number of R packages must be installed. These are:

data.table
zoo
lubridate
lfe
dummies
xlsx
stargazer
xtable
tree
treeClust
randomForest
glmnet
Hmisc
pastecs

All of these can be installed with the command install.packages('packagename')

In addition, the causalTree package from Github must be installed. For instructions on how to install causalTree, see https://github.com/susanathey/causalTree

Note: This was run in R version 3.4.

causalTree may not be compatible more recent versions of R, in which case you must install R 3.4.